package com.zycfc.zsf.boot.core.common;

public class EnvBaseConstants
{
    public String namespace;
    public String applicationName;
    public String baseNotifyUrl;
    private static EnvBaseConstants env;
    
    private EnvBaseConstants() {
    }
    
    private EnvBaseConstants(final String namespace, final String applicationName) {
        this.namespace = namespace;
        this.applicationName = applicationName;
        this.baseNotifyUrl = EnvChangingConstant.MGS_URL.get(namespace);
    }
    
    public static EnvBaseConstants build(final String namespace, final String applicationName) {
        if (EnvBaseConstants.env == null) {
            EnvBaseConstants.env = new EnvBaseConstants(namespace, applicationName);
        }
        return EnvBaseConstants.env;
    }
    
    public static EnvBaseConstants getInstance() {
        return EnvBaseConstants.env;
    }
    
    public void setNamespace(final String namespace) {
        this.namespace = namespace;
    }
    
    public void setApplicationName(final String applicationName) {
        this.applicationName = applicationName;
    }
    
    public void setBaseNotifyUrl(final String baseNotifyUrl) {
        this.baseNotifyUrl = baseNotifyUrl;
    }
    
    public String getNamespace() {
        return this.namespace;
    }
    
    public String getApplicationName() {
        return this.applicationName;
    }
    
    public String getBaseNotifyUrl() {
        return this.baseNotifyUrl;
    }
    
    static {
        EnvBaseConstants.env = null;
    }
}
